class DropRows < ActiveRecord::Migration
  def self.up
    change_table :artists do |t|
      t.remove :formdate_day
      t.remove :formdate_month
      t.remove :formdate_year
      t.remove :breakdate_day
      t.remove :breakdate_month
      t.remove :breakdate_year
      t.remove :city_id
      t.remove :country_id
    end

    change_table :editions do |t|
      t.remove :day
      t.remove :month
      t.remove :year
      t.remove :country_id
      t.remove :format
    end

    change_table :memberships do |t|
      t.remove :joindate_day
      t.remove :joindate_month
      t.remove :joindate_year
      t.remove :leftdate_day
      t.remove :leftdate_month
      t.remove :leftdate_year
    end
 
    change_table :releases do |t|
      t.remove :day
      t.remove :month
      t.remove :year
    end

    change_table :songs do |t|
      t.remove :edition_id
    end

    change_table :labels do |t|
      t.remove :foundeddate_day
      t.remove :foundeddate_month
      t.remove :foundeddate_year
      t.remove :closeddate_day
      t.remove :closeddate_month
      t.remove :closeddate_year
      t.remove :city_id
      t.remove :country_id
      t.integer :location_id
    end

    drop_table :cities
    drop_table :countries

    #remove_foreign_key(:artists, :cities)
    #remove_foreign_key(:artists, :countries)
    #remove_foreign_key(:editions, :countries)
    #remove_foreign_key(:labels, :cities)
    #remove_foreign_key(:labels, :countries)
    add_foreign_key(:labels, :locations, :column => :location_id)
  end

  def self.down
  end
end
